home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / winnetwk.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  22.3 KB  |  824 lines

  1. /*++
  2.  
  3. Copyright (c) 1991-1996  Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     winnetwk.h
  8.  
  9. Abstract:
  10.  
  11.     Standard WINNET Header File for WIN32
  12.  
  13. Environment:
  14.  
  15.     User Mode -Win32
  16.  
  17. Notes:
  18.  
  19.     optional-notes
  20.  
  21. --*/
  22.  
  23. #ifndef _WINNETWK_
  24. #define _WINNETWK_
  25. #pragma option push -b
  26.  
  27.  
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33.  
  34. //
  35. // Network types
  36. //
  37.  
  38. #define     WNNC_NET_MSNET      0x00010000
  39. #define     WNNC_NET_LANMAN     0x00020000
  40. #define     WNNC_NET_NETWARE    0x00030000
  41. #define     WNNC_NET_VINES      0x00040000
  42. #define     WNNC_NET_10NET      0x00050000
  43. #define     WNNC_NET_LOCUS      0x00060000
  44. #define     WNNC_NET_SUN_PC_NFS 0x00070000
  45. #define     WNNC_NET_LANSTEP    0x00080000
  46. #define     WNNC_NET_9TILES     0x00090000
  47. #define     WNNC_NET_LANTASTIC  0x000A0000
  48. #define     WNNC_NET_AS400      0x000B0000
  49. #define     WNNC_NET_FTP_NFS    0x000C0000
  50. #define     WNNC_NET_PATHWORKS  0x000D0000
  51. #define     WNNC_NET_LIFENET    0x000E0000
  52. #define     WNNC_NET_POWERLAN   0x000F0000
  53. #define     WNNC_NET_BWNFS      0x00100000
  54. #define     WNNC_NET_COGENT     0x00110000
  55. #define     WNNC_NET_FARALLON   0x00120000
  56. #define     WNNC_NET_APPLETALK  0x00130000
  57. #define     WNNC_NET_INTERGRAPH 0x00140000
  58. #define     WNNC_NET_SYMFONET   0x00150000
  59. #define     WNNC_NET_CLEARCASE  0x00160000
  60.  
  61.  
  62. //
  63. //  Network Resources.
  64. //
  65.  
  66. #define RESOURCE_CONNECTED      0x00000001
  67. #define RESOURCE_GLOBALNET      0x00000002
  68. #define RESOURCE_REMEMBERED     0x00000003
  69. #if(WINVER >= 0x0400)
  70. #define RESOURCE_RECENT         0x00000004
  71. #define RESOURCE_CONTEXT        0x00000005
  72. #endif /* WINVER >= 0x0400 */
  73.  
  74. #define RESOURCETYPE_ANY        0x00000000
  75. #define RESOURCETYPE_DISK       0x00000001
  76. #define RESOURCETYPE_PRINT      0x00000002
  77. #if(WINVER >= 0x0400)
  78. #define RESOURCETYPE_RESERVED   0x00000008
  79. #endif /* WINVER >= 0x0400 */
  80. #define RESOURCETYPE_UNKNOWN    0xFFFFFFFF
  81.  
  82. #define RESOURCEUSAGE_CONNECTABLE   0x00000001
  83. #define RESOURCEUSAGE_CONTAINER     0x00000002
  84. #if(WINVER >= 0x0400)
  85. #define RESOURCEUSAGE_NOLOCALDEVICE 0x00000004
  86. #define RESOURCEUSAGE_SIBLING       0x00000008
  87. #define RESOURCEUSAGE_ATTACHED      0x00000010
  88. #define RESOURCEUSAGE_ALL           (RESOURCEUSAGE_CONNECTABLE | RESOURCEUSAGE_CONTAINER | RESOURCEUSAGE_ATTACHED)
  89. #endif /* WINVER >= 0x0400 */
  90. #define RESOURCEUSAGE_RESERVED      0x80000000
  91.  
  92. #define RESOURCEDISPLAYTYPE_GENERIC        0x00000000
  93. #define RESOURCEDISPLAYTYPE_DOMAIN         0x00000001
  94. #define RESOURCEDISPLAYTYPE_SERVER         0x00000002
  95. #define RESOURCEDISPLAYTYPE_SHARE          0x00000003
  96. #define RESOURCEDISPLAYTYPE_FILE           0x00000004
  97. #define RESOURCEDISPLAYTYPE_GROUP          0x00000005
  98. #if(WINVER >= 0x0400)
  99. #define RESOURCEDISPLAYTYPE_NETWORK        0x00000006
  100. #define RESOURCEDISPLAYTYPE_ROOT           0x00000007
  101. #define RESOURCEDISPLAYTYPE_SHAREADMIN     0x00000008
  102. #define RESOURCEDISPLAYTYPE_DIRECTORY      0x00000009
  103. #endif /* WINVER >= 0x0400 */
  104. #define RESOURCEDISPLAYTYPE_TREE           0x0000000A
  105. #if(WINVER >= 0x0400)
  106. #define RESOURCEDISPLAYTYPE_NDSCONTAINER   0x0000000B
  107. #endif /* WINVER >= 0x0400 */
  108.  
  109. typedef struct  _NETRESOURCEA {
  110.     DWORD    dwScope;
  111.     DWORD    dwType;
  112.     DWORD    dwDisplayType;
  113.     DWORD    dwUsage;
  114.     LPSTR    lpLocalName;
  115.     LPSTR    lpRemoteName;
  116.     LPSTR    lpComment ;
  117.     LPSTR    lpProvider;
  118. }NETRESOURCEA, *LPNETRESOURCEA;
  119. typedef struct  _NETRESOURCEW {
  120.     DWORD    dwScope;
  121.     DWORD    dwType;
  122.     DWORD    dwDisplayType;
  123.     DWORD    dwUsage;
  124.     LPWSTR   lpLocalName;
  125.     LPWSTR   lpRemoteName;
  126.     LPWSTR   lpComment ;
  127.     LPWSTR   lpProvider;
  128. }NETRESOURCEW, *LPNETRESOURCEW;
  129. #ifdef UNICODE
  130. typedef NETRESOURCEW NETRESOURCE;
  131. typedef LPNETRESOURCEW LPNETRESOURCE;
  132. #else
  133. typedef NETRESOURCEA NETRESOURCE;
  134. typedef LPNETRESOURCEA LPNETRESOURCE;
  135. #endif // UNICODE
  136.  
  137.  
  138. //
  139. //  Network Connections.
  140. //
  141.  
  142. #define NETPROPERTY_PERSISTENT       1
  143.  
  144. #define CONNECT_UPDATE_PROFILE      0x00000001
  145. #define CONNECT_UPDATE_RECENT       0x00000002
  146. #define CONNECT_TEMPORARY           0x00000004
  147. #define CONNECT_INTERACTIVE         0x00000008
  148. #define CONNECT_PROMPT              0x00000010
  149. #define CONNECT_NEED_DRIVE          0x00000020
  150. #if(WINVER >= 0x0400)
  151. #define CONNECT_REFCOUNT            0x00000040
  152. #define CONNECT_REDIRECT            0x00000080
  153. #define CONNECT_LOCALDRIVE          0x00000100
  154. #define CONNECT_CURRENT_MEDIA       0x00000200
  155. #define CONNECT_DEFERRED            0x00000400
  156. #define CONNECT_RESERVED            0xFF000000
  157. #endif /* WINVER >= 0x0400 */
  158.  
  159.  
  160. DWORD APIENTRY
  161. WNetAddConnectionA(
  162.      LPCSTR   lpRemoteName,
  163.      LPCSTR   lpPassword,
  164.      LPCSTR   lpLocalName
  165.     );
  166. DWORD APIENTRY
  167. WNetAddConnectionW(
  168.      LPCWSTR   lpRemoteName,
  169.      LPCWSTR   lpPassword,
  170.      LPCWSTR   lpLocalName
  171.     );
  172. #ifdef UNICODE
  173. #define WNetAddConnection  WNetAddConnectionW
  174. #else
  175. #define WNetAddConnection  WNetAddConnectionA
  176. #endif // !UNICODE
  177.  
  178. DWORD APIENTRY
  179. WNetAddConnection2A(
  180.      LPNETRESOURCEA lpNetResource,
  181.      LPCSTR       lpPassword,
  182.      LPCSTR       lpUserName,
  183.      DWORD          dwFlags
  184.     );
  185. DWORD APIENTRY
  186. WNetAddConnection2W(
  187.      LPNETRESOURCEW lpNetResource,
  188.      LPCWSTR       lpPassword,
  189.      LPCWSTR       lpUserName,
  190.      DWORD          dwFlags
  191.     );
  192. #ifdef UNICODE
  193. #define WNetAddConnection2  WNetAddConnection2W
  194. #else
  195. #define WNetAddConnection2  WNetAddConnection2A
  196. #endif // !UNICODE
  197.  
  198. DWORD APIENTRY
  199. WNetAddConnection3A(
  200.      HWND           hwndOwner,
  201.      LPNETRESOURCEA lpNetResource,
  202.      LPCSTR       lpPassword,
  203.      LPCSTR       lpUserName,
  204.      DWORD          dwFlags
  205.     );
  206. DWORD APIENTRY
  207. WNetAddConnection3W(
  208.      HWND           hwndOwner,
  209.      LPNETRESOURCEW lpNetResource,
  210.      LPCWSTR       lpPassword,
  211.      LPCWSTR       lpUserName,
  212.      DWORD          dwFlags
  213.     );
  214. #ifdef UNICODE
  215. #define WNetAddConnection3  WNetAddConnection3W
  216. #else
  217. #define WNetAddConnection3  WNetAddConnection3A
  218. #endif // !UNICODE
  219.  
  220. DWORD APIENTRY
  221. WNetCancelConnectionA(
  222.      LPCSTR lpName,
  223.      BOOL     fForce
  224.     );
  225. DWORD APIENTRY
  226. WNetCancelConnectionW(
  227.      LPCWSTR lpName,
  228.      BOOL     fForce
  229.     );
  230. #ifdef UNICODE
  231. #define WNetCancelConnection  WNetCancelConnectionW
  232. #else
  233. #define WNetCancelConnection  WNetCancelConnectionA
  234. #endif // !UNICODE
  235.  
  236. DWORD APIENTRY
  237. WNetCancelConnection2A(
  238.      LPCSTR lpName,
  239.      DWORD    dwFlags,
  240.      BOOL     fForce
  241.     );
  242. DWORD APIENTRY
  243. WNetCancelConnection2W(
  244.      LPCWSTR lpName,
  245.      DWORD    dwFlags,
  246.      BOOL     fForce
  247.     );
  248. #ifdef UNICODE
  249. #define WNetCancelConnection2  WNetCancelConnection2W
  250. #else
  251. #define WNetCancelConnection2  WNetCancelConnection2A
  252. #endif // !UNICODE
  253.  
  254. DWORD APIENTRY
  255. WNetGetConnectionA(
  256.      LPCSTR lpLocalName,
  257.      LPSTR  lpRemoteName,
  258.      LPDWORD  lpnLength
  259.     );
  260. DWORD APIENTRY
  261. WNetGetConnectionW(
  262.      LPCWSTR lpLocalName,
  263.      LPWSTR  lpRemoteName,
  264.      LPDWORD  lpnLength
  265.     );
  266. #ifdef UNICODE
  267. #define WNetGetConnection  WNetGetConnectionW
  268. #else
  269. #define WNetGetConnection  WNetGetConnectionA
  270. #endif // !UNICODE
  271.  
  272.  
  273. #if(WINVER >= 0x0400)
  274. DWORD APIENTRY
  275. WNetUseConnectionA(
  276.     HWND            hwndOwner,
  277.     LPNETRESOURCEA  lpNetResource,
  278.     LPCSTR        lpUserID,
  279.     LPCSTR        lpPassword,
  280.     DWORD           dwFlags,
  281.     LPSTR         lpAccessName,
  282.     LPDWORD         lpBufferSize,
  283.     LPDWORD         lpResult
  284.     );
  285. DWORD APIENTRY
  286. WNetUseConnectionW(
  287.     HWND            hwndOwner,
  288.     LPNETRESOURCEW  lpNetResource,
  289.     LPCWSTR        lpUserID,
  290.     LPCWSTR        lpPassword,
  291.     DWORD           dwFlags,
  292.     LPWSTR         lpAccessName,
  293.     LPDWORD         lpBufferSize,
  294.     LPDWORD         lpResult
  295.     );
  296. #ifdef UNICODE
  297. #define WNetUseConnection  WNetUseConnectionW
  298. #else
  299. #define WNetUseConnection  WNetUseConnectionA
  300. #endif // !UNICODE
  301.  
  302. DWORD APIENTRY
  303. WNetSetConnectionA(
  304.     LPCSTR    lpName,
  305.     DWORD       dwProperties,
  306.     LPVOID      pvValues
  307.     );
  308. DWORD APIENTRY
  309. WNetSetConnectionW(
  310.     LPCWSTR    lpName,
  311.     DWORD       dwProperties,
  312.     LPVOID      pvValues
  313.     );
  314. #ifdef UNICODE
  315. #define WNetSetConnection  WNetSetConnectionW
  316. #else
  317. #define WNetSetConnection  WNetSetConnectionA
  318. #endif // !UNICODE
  319. #endif /* WINVER >= 0x0400 */
  320.  
  321.  
  322. //
  323. //  Network Connection Dialogs.
  324. //
  325.  
  326. DWORD APIENTRY
  327. WNetConnectionDialog(
  328.     HWND  hwnd,
  329.     DWORD dwType
  330.     );
  331.  
  332. DWORD APIENTRY
  333. WNetDisconnectDialog(
  334.     HWND  hwnd,
  335.     DWORD dwType
  336.     );
  337.  
  338. #if(WINVER >= 0x0400)
  339. typedef struct _CONNECTDLGSTRUCTA{
  340.     DWORD cbStructure;       /* size of this structure in bytes */
  341.     HWND hwndOwner;          /* owner window for the dialog */
  342.     LPNETRESOURCEA lpConnRes;/* Requested Resource info    */
  343.     DWORD dwFlags;           /* flags (see below) */
  344.     DWORD dwDevNum;          /* number of devices connected to */
  345. } CONNECTDLGSTRUCTA, FAR *LPCONNECTDLGSTRUCTA;
  346. typedef struct _CONNECTDLGSTRUCTW{
  347.     DWORD cbStructure;       /* size of this structure in bytes */
  348.     HWND hwndOwner;          /* owner window for the dialog */
  349.     LPNETRESOURCEW lpConnRes;/* Requested Resource info    */
  350.     DWORD dwFlags;           /* flags (see below) */
  351.     DWORD dwDevNum;          /* number of devices connected to */
  352. } CONNECTDLGSTRUCTW, FAR *LPCONNECTDLGSTRUCTW;
  353. #ifdef UNICODE
  354. typedef CONNECTDLGSTRUCTW CONNECTDLGSTRUCT;
  355. typedef LPCONNECTDLGSTRUCTW LPCONNECTDLGSTRUCT;
  356. #else
  357. typedef CONNECTDLGSTRUCTA CONNECTDLGSTRUCT;
  358. typedef LPCONNECTDLGSTRUCTA LPCONNECTDLGSTRUCT;
  359. #endif // UNICODE
  360.  
  361. #define CONNDLG_RO_PATH     0x00000001 /* Resource path should be read-only    */
  362. #define CONNDLG_CONN_POINT  0x00000002 /* Netware -style movable connection point enabled */
  363. #define CONNDLG_USE_MRU     0x00000004 /* Use MRU combobox  */
  364. #define CONNDLG_HIDE_BOX    0x00000008 /* Hide persistent connect checkbox  */
  365.  
  366. /*
  367.  * NOTE:  Set at most ONE of the below flags.  If neither flag is set,
  368.  *        then the persistence is set to whatever the user chose during
  369.  *        a previous connection
  370.  */
  371. #define CONNDLG_PERSIST     0x00000010 /* Force persistent connection */
  372. #define CONNDLG_NOT_PERSIST 0x00000020 /* Force connection NOT persistent */
  373.  
  374. DWORD APIENTRY
  375. WNetConnectionDialog1A(
  376.     LPCONNECTDLGSTRUCTA lpConnDlgStruct
  377.     );
  378. DWORD APIENTRY
  379. WNetConnectionDialog1W(
  380.     LPCONNECTDLGSTRUCTW lpConnDlgStruct
  381.     );
  382. #ifdef UNICODE
  383. #define WNetConnectionDialog1  WNetConnectionDialog1W
  384. #else
  385. #define WNetConnectionDialog1  WNetConnectionDialog1A
  386. #endif // !UNICODE
  387.  
  388. typedef struct _DISCDLGSTRUCTA{
  389.     DWORD           cbStructure;      /* size of this structure in bytes */
  390.     HWND            hwndOwner;        /* owner window for the dialog */
  391.     LPSTR           lpLocalName;      /* local device name */
  392.     LPSTR           lpRemoteName;     /* network resource name */
  393.     DWORD           dwFlags;          /* flags */
  394. } DISCDLGSTRUCTA, FAR *LPDISCDLGSTRUCTA;
  395. typedef struct _DISCDLGSTRUCTW{
  396.     DWORD           cbStructure;      /* size of this structure in bytes */
  397.     HWND            hwndOwner;        /* owner window for the dialog */
  398.     LPWSTR          lpLocalName;      /* local device name */
  399.     LPWSTR          lpRemoteName;     /* network resource name */
  400.     DWORD           dwFlags;          /* flags */
  401. } DISCDLGSTRUCTW, FAR *LPDISCDLGSTRUCTW;
  402. #ifdef UNICODE
  403. typedef DISCDLGSTRUCTW DISCDLGSTRUCT;
  404. typedef LPDISCDLGSTRUCTW LPDISCDLGSTRUCT;
  405. #else
  406. typedef DISCDLGSTRUCTA DISCDLGSTRUCT;
  407. typedef LPDISCDLGSTRUCTA LPDISCDLGSTRUCT;
  408. #endif // UNICODE
  409.  
  410. #define DISC_UPDATE_PROFILE         0x00000001
  411. #define DISC_NO_FORCE               0x00000040
  412.  
  413. DWORD APIENTRY
  414. WNetDisconnectDialog1A(
  415.     LPDISCDLGSTRUCTA lpConnDlgStruct
  416.     );
  417. DWORD APIENTRY
  418. WNetDisconnectDialog1W(
  419.     LPDISCDLGSTRUCTW lpConnDlgStruct
  420.     );
  421. #ifdef UNICODE
  422. #define WNetDisconnectDialog1  WNetDisconnectDialog1W
  423. #else
  424. #define WNetDisconnectDialog1  WNetDisconnectDialog1A
  425. #endif // !UNICODE
  426. #endif /* WINVER >= 0x0400 */
  427.  
  428.  
  429. //
  430. //  Network Browsing.
  431. //
  432.  
  433. DWORD APIENTRY
  434. WNetOpenEnumA(
  435.      DWORD          dwScope,
  436.      DWORD          dwType,
  437.      DWORD          dwUsage,
  438.      LPNETRESOURCEA lpNetResource,
  439.      LPHANDLE       lphEnum
  440.     );
  441. DWORD APIENTRY
  442. WNetOpenEnumW(
  443.      DWORD          dwScope,
  444.      DWORD          dwType,
  445.      DWORD          dwUsage,
  446.      LPNETRESOURCEW lpNetResource,
  447.      LPHANDLE       lphEnum
  448.     );
  449. #ifdef UNICODE
  450. #define WNetOpenEnum  WNetOpenEnumW
  451. #else
  452. #define WNetOpenEnum  WNetOpenEnumA
  453. #endif // !UNICODE
  454.  
  455. DWORD APIENTRY
  456. WNetEnumResourceA(
  457.      HANDLE  hEnum,
  458.      LPDWORD lpcCount,
  459.      LPVOID  lpBuffer,
  460.      LPDWORD lpBufferSize
  461.     );
  462. DWORD APIENTRY
  463. WNetEnumResourceW(
  464.      HANDLE  hEnum,
  465.      LPDWORD lpcCount,
  466.      LPVOID  lpBuffer,
  467.      LPDWORD lpBufferSize
  468.     );
  469. #ifdef UNICODE
  470. #define WNetEnumResource  WNetEnumResourceW
  471. #else
  472. #define WNetEnumResource  WNetEnumResourceA
  473. #endif // !UNICODE
  474.  
  475. DWORD APIENTRY
  476. WNetCloseEnum(
  477.     HANDLE   hEnum
  478.     );
  479.  
  480.  
  481.  
  482. //
  483. //  Universal Naming.
  484. //
  485.  
  486. #define UNIVERSAL_NAME_INFO_LEVEL   0x00000001
  487. #define REMOTE_NAME_INFO_LEVEL      0x00000002
  488.  
  489. typedef struct  _UNIVERSAL_NAME_INFOA {
  490.     LPSTR    lpUniversalName;
  491. }UNIVERSAL_NAME_INFOA, *LPUNIVERSAL_NAME_INFOA;
  492. typedef struct  _UNIVERSAL_NAME_INFOW {
  493.     LPWSTR   lpUniversalName;
  494. }UNIVERSAL_NAME_INFOW, *LPUNIVERSAL_NAME_INFOW;
  495. #ifdef UNICODE
  496. typedef UNIVERSAL_NAME_INFOW UNIVERSAL_NAME_INFO;
  497. typedef LPUNIVERSAL_NAME_INFOW LPUNIVERSAL_NAME_INFO;
  498. #else
  499. typedef UNIVERSAL_NAME_INFOA UNIVERSAL_NAME_INFO;
  500. typedef LPUNIVERSAL_NAME_INFOA LPUNIVERSAL_NAME_INFO;
  501. #endif // UNICODE
  502.  
  503. typedef struct  _REMOTE_NAME_INFOA {
  504.     LPSTR    lpUniversalName;
  505.     LPSTR    lpConnectionName;
  506.     LPSTR    lpRemainingPath;
  507. }REMOTE_NAME_INFOA, *LPREMOTE_NAME_INFOA;
  508. typedef struct  _REMOTE_NAME_INFOW {
  509.     LPWSTR   lpUniversalName;
  510.     LPWSTR   lpConnectionName;
  511.     LPWSTR   lpRemainingPath;
  512. }REMOTE_NAME_INFOW, *LPREMOTE_NAME_INFOW;
  513. #ifdef UNICODE
  514. typedef REMOTE_NAME_INFOW REMOTE_NAME_INFO;
  515. typedef LPREMOTE_NAME_INFOW LPREMOTE_NAME_INFO;
  516. #else
  517. typedef REMOTE_NAME_INFOA REMOTE_NAME_INFO;
  518. typedef LPREMOTE_NAME_INFOA LPREMOTE_NAME_INFO;
  519. #endif // UNICODE
  520.  
  521. DWORD APIENTRY
  522. WNetGetUniversalNameA(
  523.      LPCSTR lpLocalPath,
  524.      DWORD    dwInfoLevel,
  525.      LPVOID   lpBuffer,
  526.      LPDWORD  lpBufferSize
  527.      );
  528. DWORD APIENTRY
  529. WNetGetUniversalNameW(
  530.      LPCWSTR lpLocalPath,
  531.      DWORD    dwInfoLevel,
  532.      LPVOID   lpBuffer,
  533.      LPDWORD  lpBufferSize
  534.      );
  535. #ifdef UNICODE
  536. #define WNetGetUniversalName  WNetGetUniversalNameW
  537. #else
  538. #define WNetGetUniversalName  WNetGetUniversalNameA
  539. #endif // !UNICODE
  540.  
  541. //
  542. //  Authentication and Logon/Logoff.
  543. //
  544.  
  545. DWORD APIENTRY
  546. WNetGetUserA(
  547.      LPCSTR  lpName,
  548.      LPSTR   lpUserName,
  549.      LPDWORD   lpnLength
  550.     );
  551. DWORD APIENTRY
  552. WNetGetUserW(
  553.      LPCWSTR  lpName,
  554.      LPWSTR   lpUserName,
  555.      LPDWORD   lpnLength
  556.     );
  557. #ifdef UNICODE
  558. #define WNetGetUser  WNetGetUserW
  559. #else
  560. #define WNetGetUser  WNetGetUserA
  561. #endif // !UNICODE
  562.  
  563.  
  564.  
  565.  
  566. //
  567. // Other.
  568. //
  569.  
  570. #if(WINVER >= 0x0400)
  571. #define WNFMT_MULTILINE         0x01
  572. #define WNFMT_ABBREVIATED       0x02
  573. #define WNFMT_INENUM            0x10
  574. #define WNFMT_CONNECTION        0x20
  575. #endif /* WINVER >= 0x0400 */
  576.  
  577.  
  578. #if(WINVER >= 0x0400)
  579. DWORD APIENTRY
  580. WNetGetProviderNameA(
  581.     DWORD   dwNetType,
  582.     LPSTR lpProviderName,
  583.     LPDWORD lpBufferSize
  584.     );
  585. DWORD APIENTRY
  586. WNetGetProviderNameW(
  587.     DWORD   dwNetType,
  588.     LPWSTR lpProviderName,
  589.     LPDWORD lpBufferSize
  590.     );
  591. #ifdef UNICODE
  592. #define WNetGetProviderName  WNetGetProviderNameW
  593. #else
  594. #define WNetGetProviderName  WNetGetProviderNameA
  595. #endif // !UNICODE
  596.  
  597. typedef struct _NETINFOSTRUCT{
  598.     DWORD cbStructure;
  599.     DWORD dwProviderVersion;
  600.     DWORD dwStatus;
  601.     DWORD dwCharacteristics;
  602.     DWORD dwHandle;
  603.     WORD  wNetType;
  604.     DWORD dwPrinters;
  605.     DWORD dwDrives;
  606. } NETINFOSTRUCT, FAR *LPNETINFOSTRUCT;
  607.  
  608. #define NETINFO_DLL16       0x00000001  /* Provider running as 16 bit Winnet Driver */
  609. #define NETINFO_DISKRED     0x00000004  /* Provider requires disk redirections to connect */
  610. #define NETINFO_PRINTERRED  0x00000008  /* Provider requires printer redirections to connect */
  611.  
  612. DWORD APIENTRY
  613. WNetGetNetworkInformationA(
  614.     LPCSTR          lpProvider,
  615.     LPNETINFOSTRUCT   lpNetInfoStruct
  616.     );
  617. DWORD APIENTRY
  618. WNetGetNetworkInformationW(
  619.     LPCWSTR          lpProvider,
  620.     LPNETINFOSTRUCT   lpNetInfoStruct
  621.     );
  622. #ifdef UNICODE
  623. #define WNetGetNetworkInformation  WNetGetNetworkInformationW
  624. #else
  625. #define WNetGetNetworkInformation  WNetGetNetworkInformationA
  626. #endif // !UNICODE
  627.  
  628. //
  629. //  User Profiles.
  630. //
  631.  
  632. typedef UINT (FAR PASCAL *PFNGETPROFILEPATHA) (
  633.     LPCSTR    pszUsername,
  634.     LPSTR     pszBuffer,
  635.     UINT        cbBuffer
  636.     );
  637. typedef UINT (FAR PASCAL *PFNGETPROFILEPATHW) (
  638.     LPCWSTR    pszUsername,
  639.     LPWSTR     pszBuffer,
  640.     UINT        cbBuffer
  641.     );
  642. #ifdef UNICODE
  643. #define PFNGETPROFILEPATH  PFNGETPROFILEPATHW
  644. #else
  645. #define PFNGETPROFILEPATH  PFNGETPROFILEPATHA
  646. #endif // !UNICODE
  647.  
  648. typedef UINT (FAR PASCAL *PFNRECONCILEPROFILEA) (
  649.     LPCSTR    pszCentralFile,
  650.     LPCSTR    pszLocalFile,
  651.     DWORD       dwFlags
  652.     );
  653. typedef UINT (FAR PASCAL *PFNRECONCILEPROFILEW) (
  654.     LPCWSTR    pszCentralFile,
  655.     LPCWSTR    pszLocalFile,
  656.     DWORD       dwFlags
  657.     );
  658. #ifdef UNICODE
  659. #define PFNRECONCILEPROFILE  PFNRECONCILEPROFILEW
  660. #else
  661. #define PFNRECONCILEPROFILE  PFNRECONCILEPROFILEA
  662. #endif // !UNICODE
  663.  
  664. #define RP_LOGON    0x01        /* if set, do for logon, else for logoff */
  665. #define RP_INIFILE  0x02        /* if set, reconcile .INI file, else reg. hive */
  666.  
  667.  
  668. //
  669. //  Policies.
  670. //
  671.  
  672. typedef BOOL (FAR PASCAL *PFNPROCESSPOLICIESA) (
  673.     HWND        hwnd,
  674.     LPCSTR    pszPath,
  675.     LPCSTR    pszUsername,
  676.     LPCSTR    pszComputerName,
  677.     DWORD       dwFlags
  678.     );
  679. typedef BOOL (FAR PASCAL *PFNPROCESSPOLICIESW) (
  680.     HWND        hwnd,
  681.     LPCWSTR    pszPath,
  682.     LPCWSTR    pszUsername,
  683.     LPCWSTR    pszComputerName,
  684.     DWORD       dwFlags
  685.     );
  686. #ifdef UNICODE
  687. #define PFNPROCESSPOLICIES  PFNPROCESSPOLICIESW
  688. #else
  689. #define PFNPROCESSPOLICIES  PFNPROCESSPOLICIESA
  690. #endif // !UNICODE
  691.  
  692. #define PP_DISPLAYERRORS    0x01    /* if set, display error messages, else fail silently if error */
  693. #endif /* WINVER >= 0x0400 */
  694.  
  695.  
  696. //
  697. //  Error handling.
  698. //
  699.  
  700. DWORD APIENTRY
  701. WNetGetLastErrorA(
  702.      LPDWORD    lpError,
  703.      LPSTR    lpErrorBuf,
  704.      DWORD      nErrorBufSize,
  705.      LPSTR    lpNameBuf,
  706.      DWORD      nNameBufSize
  707.     );
  708. DWORD APIENTRY
  709. WNetGetLastErrorW(
  710.      LPDWORD    lpError,
  711.      LPWSTR    lpErrorBuf,
  712.      DWORD      nErrorBufSize,
  713.      LPWSTR    lpNameBuf,
  714.      DWORD      nNameBufSize
  715.     );
  716. #ifdef UNICODE
  717. #define WNetGetLastError  WNetGetLastErrorW
  718. #else
  719. #define WNetGetLastError  WNetGetLastErrorA
  720. #endif // !UNICODE
  721.  
  722. //
  723. //  STATUS CODES
  724. //
  725.  
  726. // General
  727.  
  728. #define WN_SUCCESS                      NO_ERROR
  729. #define WN_NO_ERROR                     NO_ERROR
  730. #define WN_NOT_SUPPORTED                ERROR_NOT_SUPPORTED
  731. #define WN_CANCEL                       ERROR_CANCELLED
  732. #define WN_RETRY                        ERROR_RETRY
  733. #define WN_NET_ERROR                    ERROR_UNEXP_NET_ERR
  734. #define WN_MORE_DATA                    ERROR_MORE_DATA
  735. #define WN_BAD_POINTER                  ERROR_INVALID_ADDRESS
  736. #define WN_BAD_VALUE                    ERROR_INVALID_PARAMETER
  737. #define WN_BAD_USER                     ERROR_BAD_USERNAME
  738. #define WN_BAD_PASSWORD                 ERROR_INVALID_PASSWORD
  739. #define WN_ACCESS_DENIED                ERROR_ACCESS_DENIED
  740. #define WN_FUNCTION_BUSY                ERROR_BUSY
  741. #define WN_WINDOWS_ERROR                ERROR_UNEXP_NET_ERR
  742. #define WN_OUT_OF_MEMORY                ERROR_NOT_ENOUGH_MEMORY
  743. #define WN_NO_NETWORK                   ERROR_NO_NETWORK
  744. #define WN_EXTENDED_ERROR               ERROR_EXTENDED_ERROR
  745. #define WN_BAD_LEVEL                    ERROR_INVALID_LEVEL
  746. #define WN_BAD_HANDLE                   ERROR_INVALID_HANDLE
  747. #if(WINVER >= 0x0400)
  748. #define WN_NOT_INITIALIZING             ERROR_ALREADY_INITIALIZED
  749. #define WN_NO_MORE_DEVICES              ERROR_NO_MORE_DEVICES
  750. #endif /* WINVER >= 0x0400 */
  751.  
  752. // Connection
  753.  
  754. #define WN_NOT_CONNECTED                ERROR_NOT_CONNECTED
  755. #define WN_OPEN_FILES                   ERROR_OPEN_FILES
  756. #define WN_DEVICE_IN_USE                ERROR_DEVICE_IN_USE
  757. #define WN_BAD_NETNAME                  ERROR_BAD_NET_NAME
  758. #define WN_BAD_LOCALNAME                ERROR_BAD_DEVICE
  759. #define WN_ALREADY_CONNECTED            ERROR_ALREADY_ASSIGNED
  760. #define WN_DEVICE_ERROR                 ERROR_GEN_FAILURE
  761. #define WN_CONNECTION_CLOSED            ERROR_CONNECTION_UNAVAIL
  762. #define WN_NO_NET_OR_BAD_PATH           ERROR_NO_NET_OR_BAD_PATH
  763. #define WN_BAD_PROVIDER                 ERROR_BAD_PROVIDER
  764. #define WN_CANNOT_OPEN_PROFILE          ERROR_CANNOT_OPEN_PROFILE
  765. #define WN_BAD_PROFILE                  ERROR_BAD_PROFILE
  766. #define WN_BAD_DEV_TYPE                 ERROR_BAD_DEV_TYPE
  767. #define WN_DEVICE_ALREADY_REMEMBERED    ERROR_DEVICE_ALREADY_REMEMBERED
  768.  
  769. // Enumeration
  770.  
  771. #define WN_NO_MORE_ENTRIES              ERROR_NO_MORE_ITEMS
  772. #define WN_NOT_CONTAINER                ERROR_NOT_CONTAINER
  773.  
  774. #if(WINVER >= 0x0400)
  775. // Authentication
  776.  
  777. #define WN_NOT_AUTHENTICATED            ERROR_NOT_AUTHENTICATED
  778. #define WN_NOT_LOGGED_ON                ERROR_NOT_LOGGED_ON
  779. #define WN_NOT_VALIDATED                ERROR_NO_LOGON_SERVERS
  780. #endif /* WINVER >= 0x0400 */
  781.  
  782.  
  783. //
  784. //  For Shell
  785. //
  786.  
  787. #if(WINVER >= 0x0400)
  788. typedef struct _NETCONNECTINFOSTRUCT{
  789.     DWORD cbStructure;
  790.     DWORD dwFlags;
  791.     DWORD dwSpeed;
  792.     DWORD dwDelay;
  793.     DWORD dwOptDataSize;
  794. } NETCONNECTINFOSTRUCT,  *LPNETCONNECTINFOSTRUCT;
  795.  
  796. #define WNCON_FORNETCARD        0x00000001
  797. #define WNCON_NOTROUTED         0x00000002
  798. #define WNCON_SLOWLINK          0x00000004
  799. #define WNCON_DYNAMIC           0x00000008
  800.  
  801. DWORD APIENTRY
  802. MultinetGetConnectionPerformanceA(
  803.         LPNETRESOURCEA lpNetResource,
  804.         LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct
  805.         );
  806. DWORD APIENTRY
  807. MultinetGetConnectionPerformanceW(
  808.         LPNETRESOURCEW lpNetResource,
  809.         LPNETCONNECTINFOSTRUCT lpNetConnectInfoStruct
  810.         );
  811. #ifdef UNICODE
  812. #define MultinetGetConnectionPerformance  MultinetGetConnectionPerformanceW
  813. #else
  814. #define MultinetGetConnectionPerformance  MultinetGetConnectionPerformanceA
  815. #endif // !UNICODE
  816. #endif /* WINVER >= 0x0400 */
  817.  
  818. #ifdef __cplusplus
  819. }
  820. #endif
  821.  
  822. #pragma option pop
  823. #endif  // _WINNETWK_
  824.